package cc.chinagps.gateway.client.packet;

import cc.chinagps.gateway.client.bean.PacketType;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
import lombok.Data;
import lombok.ToString;

@Data
public class RequestPacket {
    private PacketType packetType;
    @ToString.Exclude
    private ByteBuf data;
    private String source;
    private long createTime;

    public RequestPacket(PacketType packetType, ByteBuf data) {
        this.packetType = packetType;
        this.data = data;
        source = ByteBufUtil.hexDump(data);
        createTime =  System.currentTimeMillis();
    }
}
